package com.malty.apisdk;

import com.malty.apisdk.client.ApiClient;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * 接口开放平台sdk配置
 *
 * @author malty
 */
@Configuration
@ConfigurationProperties("api-hub.client")
@Data
@NoArgsConstructor
@ComponentScan
public class ApiClientConfig {

    private String accessKey;

    private String secretKey;

    public ApiClientConfig(String accessKey, String secretKey) {
        this.accessKey = accessKey;
        this.secretKey = secretKey;
    }

    @Bean
    public ApiClient apiClient() {
        return new ApiClient(accessKey, secretKey);
    }

}
